package com.itsu.integration.service.impl;

import org.springframework.integration.handler.advice.AbstractRequestHandlerAdvice;
import org.springframework.messaging.Message;
import org.springframework.stereotype.Component;

/**
 * 自定义call ws 前的操作，可用来记录日志/DB等等
 * @author suben
 * @date 2020/5/1 20:23
 */
@Component
public class BeforeCallWs extends AbstractRequestHandlerAdvice {


    @Override
    protected Object doInvoke(ExecutionCallback callback, Object target, Message<?> message) {
        System.out.println(target.getClass());
        System.out.println(message.getPayload().toString());
        return callback.execute();
    }
}
